class User:
    """创建一个User类"""
    def __init__(self, first_name, last_name, age, carer):
        self.first_name = first_name
        self.last_name = last_name
        self.age = age
        self.carer = carer
        self.login_attempts = 0

    def describe_user(self):
        print('\n展示用户信息:')
        print(f"\t用户名:{self.first_name} {self.last_name}")
        print(f"\t年龄:{self.age}")
        print(f"\t身份:{self.carer}")

    def greet_user(self):
        print(f"\n你好:{self.first_name} {self.last_name},祝您身体健康,万事如意")

    def increment_login_attempts(self):
        self.login_attempts += 1

    def print_user_login(self):
        print(self.login_attempts)

    def reset_login_attempts(self):
        self.login_attempts = 0


# user1 = User("李","铭晗",24,"学生")
# user1.increment_login_attempts()
# user1.increment_login_attempts()
# user1.increment_login_attempts()
#
# user1.print_user_login()
#
# user1.reset_login_attempts()
# user1.print_user_login()


class Privileges:
    def __init__(self):
        self.privileges = ['can add post','can delete post','cam ban user']

    def show_privileges(self):
        for privilege in self.privileges:
            print(f"{privilege}")


class Admin(User):
    """模拟管理员"""
    def __init__(self,first_name, last_name, age, carer):
        super().__init__(first_name,last_name,age,carer)
        self.privileges = Privileges()

    def show_privileges(self):
        for privilege in self.privileges.privileges:
            print(f"admin {self.first_name.title()} {self.last_name.title()} {privilege}")


admin = Admin('tom','Lee',18,'学生')
admin.show_privileges()